package com.yh.correct.service.impl;

import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yh.correct.dao.ICommunityAdminMapper;
import com.yh.correct.dao.IEmpolymentMapper;
import com.yh.correct.model.Page;
import com.yh.correct.service.IEmpolymentService;

@Service
public class EmpolymentServiceImpl implements IEmpolymentService{
	private static Logger logger = LogManager.getLogger(ExpireServiceImpl.class);
	@Autowired
    private IEmpolymentMapper el;
	
	public Map getEmpolyment(int id) {
		// TODO Auto-generated method stub
		return el.getEmpolyment(id);
	}

	public Page getAll(Map<String, Object> cont) {
		Page page = new Page();
		page.setTotalNum(el.getLikeEmpolymentsCount(cont));
		int pageSize = Integer.parseInt(String.valueOf(cont.get("pageSize")));
		page.setPageSize(pageSize);
		int pageNum = Integer.parseInt(String.valueOf(cont.get("pageNum")));
		page.setCurPageNum(pageNum);
		page.setTotalPage(page.getTotalNum() / pageSize + (page.getTotalNum() % pageSize == 0 ? 0 : 1));
		page.setResult(el.getLikeEmpolyments(cont));
		logger.debug("模糊查询结果"+page.getResult());
		return page;
		
		
		
	}



}
